CSS fluid type sizing based on viewport

48

/* NOTE: The [brackets] are not included in the syntax. 
BUT, the 'px' denomination needs to be.
If 'px' is not noted, it's just the numerical value. */

.whateverClassBeingTargeted {
  font-size: calc([minimum size px] + ([maximum size] - [minimum size]) * ((100vw - [minimum viewport widthpx]) / ([maximum viewport width] - [minimum viewport width])));
}

/* THERE IS ALSO 'CLAMP' BUT IT HASN'T BEEN CONSISTENT AMONG ALL BROWSERS */ 

Comments

Submit
0 Comments